/*
 * Intro.cpp
 *
 *  Created on: Jan 13, 2013
 *      Author: raysue
 */

#include "game/cutscenes/Intro.h"
#include "core/GameObject.h"
#include "component/Doodle.h"
#include "component/Animation.h"

using namespace eats_core;

Intro::Intro() {

    old_time = SDL_GetTicks();

}

Intro::~Intro() {

}

bool Intro::setUp()
{

    GameObject * backGroundImg = new GameObject( _working_surface, _working_surface->w /2,  _working_surface->h / 2);

    backGroundImg -> _canonical_name = "Logo";

    Doodle * logoDoodle  = new Doodle("/opt/attacks/resources/logo_m.jpeg", backGroundImg->workingSurf ,
    		backGroundImg->getX(), backGroundImg->getY() , true);

    backGroundImg->addComponent(logoDoodle);
    backGroundImg->enableComponent(logoDoodle);

    objList.push_back(backGroundImg);

    return true && GameState::setUp();
}

void Intro::update()
{
	if (old_time + 3000 < SDL_GetTicks() ) {
		state = finished;
	}

	GameState::update();

}



